'use strict';

/**
 * 分类表种子数据
 */
module.exports = {
  up: async (queryInterface, Sequelize) => {
    // 先清空表中的数据
    await queryInterface.bulkDelete('categories', null, {});
    // 然后插入新数据
    await queryInterface.bulkInsert('categories', [
      {
        id: 1,
        name: '动画',
        alias: 'anime',
        description: '动画相关内容',
        parent_id: null,
        level: 1,
        sort_order: 1,
        video_count: 0,
        status: 1,
        created_at: new Date(),
        updated_at: new Date()
      },
      {
        id: 2,
        name: '音乐',
        alias: 'music',
        description: '音乐相关内容',
        parent_id: null,
        level: 1,
        sort_order: 2,
        video_count: 0,
        status: 1,
        created_at: new Date(),
        updated_at: new Date()
      },
      {
        id: 3,
        name: '游戏',
        alias: 'game',
        description: '游戏相关内容',
        parent_id: null,
        level: 1,
        sort_order: 3,
        video_count: 0,
        status: 1,
        created_at: new Date(),
        updated_at: new Date()
      },
      {
        id: 4,
        name: '科技',
        alias: 'tech',
        description: '科技相关内容',
        parent_id: null,
        level: 1,
        sort_order: 4,
        video_count: 0,
        status: 1,
        created_at: new Date(),
        updated_at: new Date()
      },
      {
        id: 5,
        name: '生活',
        alias: 'life',
        description: '生活相关内容',
        parent_id: null,
        level: 1,
        sort_order: 5,
        video_count: 0,
        status: 1,
        created_at: new Date(),
        updated_at: new Date()
      }
    ], {});
  },

  down: async (queryInterface, Sequelize) => {
    await queryInterface.bulkDelete('categories', null, {});
  }
};